<template>
  <!-- 专案信息资产管理 -->
  <div class="app-container">
    <el-form ref="formList" :model="formList" label-width="80px">
      <el-row :gutter="50">
        <el-col :span="8">
          <el-form-item label="专案名称">
            <el-select v-model="formList.ictProjectCode" placeholder="专案选项" style="width: 220px;">
              <el-option
                :label="item.label"
                :value="item.value"
                v-for="item in ict"
                :key="item.id"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="6">
          <el-form-item label="IP地址">
            <el-input v-model="formList.ipAddress" value='' style="width: 220px;"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="6">
          <el-form-item label="物理地址" ref="items">
            <el-input v-model="formList.macAddress" value='' style="width: 220px;"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="6">
          <el-form-item label="工号">
            <el-input v-model="formList.userId" value='' style="width: 220px;"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item>
            <el-button type="primary" @click="selectList(formList)">查询</el-button>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <el-col :span="24" :push="22" style="margin-bottom: 20px;"><el-button type="primary" @click="exportExcl">导出</el-button></el-col>
    <el-table :data="tableData" align='center' style="width: 100%">
      <el-table-column align='center' fixed prop="tId" label="序号">
      </el-table-column>
      <el-table-column align='center' prop="terminalType" label="终端类型" style="width: 8%;">
      </el-table-column>
      <el-table-column align='center' prop="userId" label="使用人工号">
      </el-table-column>
      <el-table-column align='center' prop="userName" label="使用人姓名">
      </el-table-column>
      <el-table-column align='center' prop="userDuty" label="使用人职位">
      </el-table-column>
      <el-table-column align='center' prop="ictProjectCode" label="专案名称">
      </el-table-column>
      <el-table-column align='center' prop="labName" label="Lab名称">
      </el-table-column>
      <el-table-column align='center' prop="auditStatus" label="审核状态">
      </el-table-column>
      <el-table-column align='center' fixed="right" label="操作" width='150px'>
        <template slot-scope="scope">
          <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
          <el-button type="text" size="small" @click="submitBtn(scope.row)" v-hasPermi="['info:infomaction:index']">审核</el-button>
          <el-button type="text" size="small" @click="delbtn(scope.row)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-dialog :visible.sync="open" width="85%" style="margin-left: 220px">
      <el-form
        :inline="true"
        :model="ruleForm"
        ref="ruleForm"
        class="demo-form-inline"
        :rules="rules"
        :label-position="labelPosition"
        label-width="170px"
      >
        <el-row
          type="flex"
          justify="space-between"
          align="middle"
          style="width: 70%; margin-left: 80px"
        >
          <el-col :span="24" :push="2">
            <el-divider content-position="center" class="title"
            >NPI专案终端信息资产清单登记表</el-divider>
          </el-col>
        </el-row>
        <el-row type="flex" justify="start" align="middle" style="margin: 0px">
          <el-col :span="12" :push="2">
            <el-form-item  prop="entryTime">
				<span slot="label">
				     	<span style="font-size: 18px;">进入NPI时间</span>
				</span>
              <el-date-picker
                v-model="ruleForm.entryTime"
                type="date"
                value-format="yyyy-MM-dd"
                placeholder="选择日期"
                style="width: 220px"
              >
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item  prop="handlerName" required>
				<span slot="label">
				     	<span style="font-size: 18px;">终端处理人员</span>
				</span>
              <el-input
                v-model="ruleForm.handlerName"
                value=""
                style="width: 220px"
                readonly
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row
          type="flex"
          justify="start"
          align="middle"
		  style="margin-left: 80px;width: 70%;"
        >
          <el-col :span="24" :push="2"
          ><el-divider content-position="center" class="title"
          >专案及Lab信息</el-divider
          ></el-col
          >
        </el-row>
        <el-row type="flex" justify="start" align="middle" style="margin: 0px">
          <el-col :span="12" :push="2">
            <el-form-item  prop="factoryCode">
				<span slot="label">
				     	<span style="font-size: 18px;">厂 区 代 码</span>
				</span>
              <el-select v-model="ruleForm.factoryCode" placeholder="请选择厂区" style="width: 220px">
                <el-option
                  :label="item.label"
                  :value="item.value"
                  v-for="item in from.factoryCode"
                  :key="item.id"
                  style="width: 220px"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item  prop="ictProjectCode">
				<span slot="label">
				     	<span style="font-size: 18px;">ICT 专 案 代 码</span>
				</span>
              <el-select
                v-model="ruleForm.ictProjectCode"
                placeholder="请选择ICT专案代码"
                style="width: 220px"
              >
                <el-option
                  :label="item.label"
                  :value="item.value"
                  v-for="item in ict"
                  :key="item.id"
                  style="width: 220px"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex" justify="start" align="middle" style="margin: 0px">
          <el-col :span="12" :push="2">
            <el-form-item  prop="projectFloor">
				<span slot="label">
				     	<span style="font-size: 18px;">专 案 楼 层</span>
				</span>
              <el-select
                v-model="ruleForm.projectFloor"
                placeholder="请选择专案楼层"
                style="width: 220px"
              >
                <el-option
                  :label="item"
                  :value="item"
                  v-for="item in from.projectFloor"
                  :key="item.id"
                  style="width: 220px"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item  prop="labName">
				<span slot="label">
				     	<span style="font-size: 18px;">所 在 Lab 名 称"</span>
				</span>
              <el-select
                v-model="ruleForm.labName"
                filterable
                allow-create
                default-first-option
                placeholder="请选择文章标签"
                style="width: 220px"
              >
                <el-option
                  v-for="item in from.labName"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                  style="width: 220px"
                >
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex" justify="start" align="middle" style="margin: 0px">
          <el-col :span="12" :push="2">
            <el-form-item  prop="labResponsibleId">
				<span slot="label">
				     	<span style="font-size: 18px;">所在Lab负责人工号</span>
				</span>
              <el-select
                v-model="ruleForm.labResponsibleId"
                filterable
                placeholder="请填写工号"
                @change="change1"
                remote
                :remote-method="remoteMethodId"
                style="width: 220px"
              >
                <el-option
                  v-for="item in labResponsibleId"
                  :key="item.value"
                  :label="item.empId"
                  :value="item.empId"
                  style="width: 220px"
                >
                  <span style="float: left">{{item.empId}}</span>
                  <span style="float: right">{{item.empName}}</span>
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item  prop="labResponsibleMail">
				<span slot="label">
				     	<span style="font-size: 18px;">Lab 负 责 人 邮 箱</span>
				</span>
              <el-input
                placeholder="根据工号查询"
                v-model="ruleForm.labResponsibleMail"
                value=""
                style="width: 220px"
                readonly
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row
          style="width: 70%; margin-left: 80px"
          type="flex"
          justify="start"
          align="middle"
        >
          <el-col :span="24" :push="2">
            <el-divider content-position="center" class="title"
            >终端所属人个人信息</el-divider
            >
          </el-col>
        </el-row>
        <el-row type="flex" justify="start" align="middle" style="margin: 0px">
          <el-col :span="12" :push="2">
            <el-form-item  prop="userId">
				<span slot="label">
				     	<span style="font-size: 18px;">电脑使用人工号</span>
				</span>
              <el-select
                v-model="ruleForm.userId"
                filterable
                placeholder="请选择"
                @change="change2"
                remote
                :remote-method="remoteMethodId"
                style="width: 220px"
              >
                <el-option
                  v-for="item in labResponsibleId"
                  :key="item.value"
                  :label="item.empId"
                  :value="item.empId"
                  style="width: 220px"
                >
                  <span style="float: left">{{item.empId}}</span>
                  <span style="float: right">{{item.empName}}</span>
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item  prop="userName">
				<span slot="label">
				     	<span style="font-size: 18px;">电脑使用人姓名</span>
				</span>
              <el-input
                placeholder="根据工号查询"
                value=""
                v-model="ruleForm.userName"
                style="width: 220px"
                readonly
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex" justify="start" align="middle" style="margin: 0px">
          <el-col :span="12" :push="2">
            <el-form-item  prop="userDuty">
				<span slot="label">
				     	<span style="font-size: 18px;">电脑使用人职位</span>
				</span>
              <el-input
                placeholder="根据工号查询"
                value=""
                v-model="ruleForm.userDuty"
                style="width: 220px"
                readonly
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item  prop="userMail">
				<span slot="label">
				     	<span style="font-size: 18px;">电脑使用人邮箱</span>
				</span>
              <el-input
                placeholder="根据工号查询"
                value=""
                v-model="ruleForm.userMail"
                style="width: 220px"
                readonly
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row
          type="flex"
          justify="start"
          align="middle"
          style="width: 70%; margin-left: 80px"
        >
          <el-col :span="24" :push="2">
            <el-divider content-position="center" class="title"
            >终端信息</el-divider
            >
          </el-col>
        </el-row>
        <el-row type="flex" justify="start" align="middle" style="margin: 0px">
          <el-col :span="12" :push="2">
            <el-form-item  prop="terminalType">
				<span slot="label">
				     	<span style="font-size: 18px;">终 端 类 型</span>
				</span>
              <el-select
                v-model="ruleForm.terminalType"
                filterable
                allow-create
                default-first-option
                placeholder="请选择终端类型"
                style="width: 220px">
                <el-option
                  v-for="item in from.terminalType"
                  :key="item.id"
                  :label="item"
                  :value="item"
                  style="width: 220px">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item  prop="terminalOs">
				<span slot="label">
				     	<span style="font-size: 18px;">终 端 系 统</span>
				</span>
              <el-select
                v-model="ruleForm.terminalOs"
                filterable
                allow-create
                default-first-option
                placeholder="请选择"
                style="width: 220px">
                <el-option
                  v-for="item in from.terminalOs"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item> </el-col>
        </el-row>
        <el-row type="flex" justify="start" align="middle" style="margin: 0px">
          <el-col :span="12" :push="2">
            <el-form-item  prop="ipAddress">
				<span slot="label">
				     	<span style="font-size: 18px;">IP 地 址</span>
				</span>
              <el-input
                placeholder="自动填写"
                value=""
                v-model="ruleForm.ipAddress"
                style="width: 220px"
                readonly
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item  prop="macAddress">
				<span slot="label">
				     	<span style="font-size: 18px;">MAC地址</span>
				</span>
              <el-input
                placeholder="自动填写"
                value=""
                v-model="ruleForm.macAddress"
                style="width: 220px"
                readonly
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex" justify="start" align="middle" style="margin: 0px">
          <el-col :span="12" :push="2">
            <el-form-item  prop="colourBar">
				<span slot="label">
				     	<span style="font-size: 18px;">彩 条</span>
				</span>
              <el-radio-group v-model="ruleForm.colourBar" style="width: 220px">
                <el-radio label="Y"><span style="font-size: 18px;">是</span></el-radio>
                <el-radio label="N"><span style="font-size: 18px;">否</span></el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item  prop="watermark">
				<span slot="label">
				     	<span style="font-size: 18px;">水 印</span>
				</span>
              <el-radio-group v-model="ruleForm.watermark" style="width: 220px">
                <el-radio label="Y"><span style="font-size: 18px;">是</span></el-radio>
                <el-radio label="N"><span style="font-size: 18px;">否</span></el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex" justify="start" align="middle" style="margin: 0px">
          <el-col :span="12" :push="2">
            <el-form-item  prop="mailPower">
				<span slot="label">
				     	<span style="font-size: 18px;">邮 箱 需 求</span>
				</span>
              <el-radio-group v-model="ruleForm.mailPower">
                <el-radio label="Y"><span style="font-size: 18px;">是</span></el-radio>
                <el-radio label="N"><span style="font-size: 18px;">否</span></el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item  prop="mailAuditId">
				<span slot="label">
				     	<span style="font-size: 18px;">邮箱审核人工号</span>
				</span>
              <el-select
                v-model="ruleForm.mailAuditId"
                filterable
                placeholder="请选择"
                @change="change3"
                remote
                :remote-method="remoteMethodId"
                style="width: 220px"
              >
                <el-option
                  v-for="item in labResponsibleId"
                  :key="item.value"
                  :label="item.empId"
                  :value="item.empId"
                  style="width: 220px"
                >
                  <span style="float: left">{{item.empId}}</span>
                  <span style="float: right">{{item.empName}}</span>
                </el-option>
              </el-select>
              
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex" justify="start" align="middle" style="margin: 0px">
          <el-col :span="12" :push="2">
            <el-form-item  prop="mailAuditDuty">
				<span slot="label">
				     	<span style="font-size: 18px;">邮箱审核人职位</span>
				</span>
              <el-input
                placeholder="请填写邮箱审核人工号"
                value=""
                v-model="ruleForm.mailAuditDuty"
                style="width: 220px"
                readonly
              ></el-input>
              
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item  prop="mailAuditMail">
				<span slot="label">
				     	<span style="font-size: 18px;">邮箱审核人邮箱</span>
				</span>
              <el-input
                placeholder="根据工号查询"
                v-model="ruleForm.mailAuditMail"
                style="width: 220px"
                readonly
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex" justify="start" align="middle" style="margin: 0px">
          <el-col :span="12" :push="2">
            <el-form-item  prop="usbPower">
				<span slot="label">
				     	<span style="font-size: 18px;">USB 权 限</span>
				</span>
              <el-radio-group v-model="ruleForm.usbPower">
                <el-radio label="Y"><span style="font-size: 18px;">是</span></el-radio>
                <el-radio label="N"><span style="font-size: 18px;">否</span></el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item  prop="takeOut">
				<span slot="label">
				     	<span style="font-size: 18px;">电脑携出权限</span>
				</span>
              <el-radio-group v-model="ruleForm.takeOut">
                <el-radio label="Y"><span style="font-size: 18px;">是</span></el-radio>
                <el-radio label="N"><span style="font-size: 18px;">否</span></el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex" justify="start" align="middle" style="margin: 0px">
          <el-col :span="12" :push="2">
            <el-form-item  prop="dualFactor">
				<span slot="label">
				     	<span style="font-size: 18px;">双 因 素</span>
				</span>
              <el-radio-group v-model="ruleForm.dualFactor">
                <el-radio label="Y"><span style="font-size: 18px;">是</span></el-radio>
                <el-radio label="N"><span style="font-size: 18px;">否</span></el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item  prop="tokenId">
				<span slot="label">
				     	<span style="font-size: 18px;">令牌/指纹仪编号</span>
				</span>
              <el-input
                placeholder="手动填写"
                v-model="ruleForm.tokenId"
                style="width: 220px"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row
          type="flex"
          justify="start"
          align="middle"
          style="width: 70%; margin-left:80px"
        >
          <el-col :span="24" :push="2">
            <el-divider content-position="center" class="title"
            >客户系统</el-divider
            >
          </el-col>
        </el-row>
        <el-row type="flex" justify="start" align="middle" style="margin: 0px">
          <el-col :span="12" :push="2">
            <el-form-item  prop="clientPower">
				<span slot="label">
				     	<span style="font-size: 18px;">是否有客户系统权限</span>
				</span>
              <el-radio-group v-model="ruleForm.clientPower">
                <el-radio label="Y"><span style="font-size: 18px;">是</span></el-radio>
                <el-radio label="N"><span style="font-size: 18px;">否</span></el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item  prop="siftAccount">
				<span slot="label">
				     	<span style="font-size: 18px;">sift 账 号</span>
				</span>
              <el-input
                placeholder="手动填写"
                v-model="ruleForm.siftAccount"
                style="width: 220px"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex" justify="start" align="middle" style="margin: 0px">
          <el-col :span="12" :push="2">
            <el-form-item  prop="inclineAccount">
				<span slot="label">
				     	<span style="font-size: 18px;">incline 账 号</span>
				</span>
              <el-input
                placeholder="手动填写"
                v-model="ruleForm.inclineAccount"
                value=""
                style="width: 220px"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item  prop="radarAccount">
				<span slot="label">
				     	<span style="font-size: 18px;">radar 账 号</span>
				</span>
              <el-input
                placeholder="手动填写"
                v-model="ruleForm.radarAccount"
                value=""
                style="width: 220px"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex" justify="start" align="middle" style="margin: 0px">
          <el-col :span="12" :push="2">
            <el-form-item  prop="imessageAccount">
				<span slot="label">
				     	<span style="font-size: 18px;">iMessage 账 号</span>
				</span>
              <el-input
                placeholder="手动填写"
                v-model="ruleForm.imessageAccount"
                value=""
                style="width: 220px"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row
          type="flex"
          justify="space-between"
          align="middle"
          style="margin: 0px"
          class="bottomBtn"
        >
          <el-col :span="7" :push="2">
            <el-form-item>
              <el-button type="primary" @click="saveChange(ruleForm)"
                         v-hasPermi="['info:infomaction:index']"
              >保存变更</el-button>
            </el-form-item>
          </el-col>
          <el-col :span="7" :push="1">
            <el-form-item>
              <el-button type="primary" @click="approve(ruleForm)" v-hasPermi="['info:infomaction:index']">提交审核</el-button>
            </el-form-item>
          </el-col>
          <el-col :span="7">
            <el-form-item>
              <el-button type="primary" @click="refresh(ruleForm)">刷新</el-button>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </el-dialog>
  </div>
</template>

<script>
import {getInfomactionList,exportInfomaction,delInfomaction} from '../../../api/info/infomaction'
import {
  getInforDemo,
  updateInforDemo,
  getInforDemoList,
  listFloor
} from "../../../api/mine/inforDemo";
import { getInformationValue } from "@/api/mine/projectAuditMatter";
import{getoptionValue}from "@/api/info/projectMgmt.js"

export default {
  name: "Infomaction",
  data() {
    return {
      ict:[],
      tableData:[],
      ctProjectCode:[],
      // ip地址  getInforDemo   updateInforDemo
      ip: "",
      region: [1],
      form: {
        ictProjectCode: ["1","2"],
        ipAddress: "",
        macAddress: "",
        userId: "",
      },
      formList: {
        ictProjectCode:"",
        ipAddress: "",
        macAddress: "",
        userId: "",
      },
      //   列表
      open: false,
      options4: [],
      saveButton: true,
      cancelButton: true,
      backButton: true,
      submitButton: true,
      loading: true,
      total: 10,
      labelPosition: "left",
      // 所有员工
      labNumber: [],
      ruleForm: {
        imessageAccount: "",
        radarAccount: "",
        inclineAccount: "",
        siftAccount: "",
        clientPower: "",
        tokenId: "",
        dualFactor: "",
        takeOut: "",
        usbPower: "",
        mailAuditMail: "",
        mailAuditDuty: "",
        // mailAuditName:"",
        mailAuditId: "",
        mailPower: "",
        watermark: "",
        colourBar: "",
        macAddress: "",
        ipAddress: "",
        terminalOs: "",
        terminalType: "",
        userMail: "",
        userDuty: "",
        userName: "",
        userId: "",
        labResponsibleMail: "",
        labResponsibleId: "",
        labName: "",
        projectFloor: "",
        ictProjectCode: "",
        factoryCode: "",
        handlerName: "",
        // handlerId:"",
        entryTime: "",
        // 审核状态
        auditStatus: "",
      },
      from: {
        // 厂区代码
        factoryCode: [1],
        // ICT专案
        // ictProjectCode: [2],
        // 专案楼层
        projectFloor: [3],
        // 所在Lab名称
        labName: [4],
        // 终端类型
        terminalType: ["html"],
        // 终端系统
        terminalOs: [6],
        // 维护层面
        reqLevel:[],
        labResponsibleId: [],
      },
     
      rules: {
        entryTime: [{ required: true, message: "请选择时间", trigger: "blur" }],
        handlerId: [{ required: true, message: "请输入ID", trigger: "blur" }],
        handlerName: [
          { required: true, message: "请输入姓名", trigger: "blur" },
        ],
        factoryCode: [
          { required: true, message: "请选择厂区代码", trigger: "blur" },
        ],
        projectFloor: [
          { required: true, message: "请选择专案楼层", trigger: "blur" },
        ],
        ictProjectCode: [
          { required: true, message: "请选择专案", trigger: "blur" },
        ],
        labName: [
          { required: true, message: "请选择Lab名称", trigger: "blur" },
        ],
        labResponsibleId: [
          {
            required: true,
            message: "请输入所在Lab负责人工号",
            trigger: "blur",
          },
        ],
        labResponsibleMail: [
          {
            required: true,
            message: "请输入所在Lab负责人邮箱",
            trigger: "blur",
          },
        ],
        userId: [
          { required: true, message: "请输入Lab负责人工号", trigger: "blur" },
        ],
        userName: [
          { required: true, message: "请输入电脑使用人姓名 ", trigger: "blur" },
        ],
        userDuty: [
          { required: true, message: "请输入电脑使用人职位", trigger: "blur" },
        ],
        mailPower: [
          { required: true, message: "请选择是否有邮箱需求", trigger: "blur" },
        ],
        watermark: [
          { required: true, message: "请选择是否有水印", trigger: "blur" },
        ],
        userMail: [
          { required: true, message: "请输入电脑使用人邮箱", trigger: "blur" },
        ],
        terminalType: [
          { required: true, message: "请选择终端类型", trigger: "blur" },
        ],
        terminalOs: [
          { required: true, message: "请选择终端系统", trigger: "blur" },
        ],
        ipAddress: [
          { required: true, message: "请输入ip地址", trigger: "blur" },
        ],
        macAddress: [
          { required: true, message: "请输入MAC地址", trigger: "blur" },
        ],
        colourBar: [
          { required: true, message: "请选择是否有彩条",trigger: "blur" },
        ],
        mailAuditId: [
          { required: true, message: "请输入邮箱审核人工号", trigger: "blur" },
        ],
        mailAuditName: [
          { required: true, message: "请输入邮箱审核人姓名", trigger: "blur" },
        ],
        mailAuditDuty: [
          { required: true, message: '请输入"邮箱审核人职务', trigger: "blur" },
        ],
        mailAuditMail: [
          { required: true, message: "请输入邮箱审核人邮箱", trigger: "blur" },
        ],
        usbPower: [
          { required: true, message: "请选择是否有USB权限", trigger: "blur" },
        ],
        takeOut: [
          {
            required: true,
            message: "请选择是否有电脑携带权限",
            trigger: "blur",
          },
        ],
        dualFactor: [
          { required: true, message: "请选择双因素", trigger: "blur" },
        ],
        tokenId: [
          {
            required: true,
            message: "请选择是否有令牌/指纹编号",
            trigger: "blur",
          },
        ],
        clientPower: [
          {
            required: true,
            message: "请选择是否有客户系统权限",
            trigger: "blur",
          },
        ],
        siftAccount: [
          { required: true, message: "请输入SIFT账号", trigger: "blur" },
        ],
        inclineAccount: [
          { required: true, message: "请输入INCLINE账号", trigger: "blur" },
        ],
        imessageAccount: [
          { required: true, message: "请输入IMESSAGE账号", trigger: "blur" },
        ],
        radarAccount: [
          { required: true, message: "请输入RADAR账号", trigger: "blur" },
        ],
      },
      area: [1],
      ICTCase: [2],
      level: [3],
      LabName: [4],
      terminalType: [5],
      terminalSys: [6],
      reqLevel: [7],
      labResponsibleId:[]
    };
  },
  methods: {
    change1(value) {
      for (var i = 0; i < this.labResponsibleId.length; i++) {
        if (this.labResponsibleId[i].empId == value) {
          this.loading = true;
          this.ruleForm.labResponsibleMail = this.labResponsibleId[i].mail;
        }
      }
    },
    change2(value) {
      for (var i = 0; i < this.labResponsibleId.length; i++) {
        if (this.labResponsibleId[i].empId == value) {
          this.loading = true;
          this.ruleForm.userMail = this.labResponsibleId[i].mail;
          this.ruleForm.userName = this.labResponsibleId[i].empName;
          this.ruleForm.userDuty = this.labResponsibleId[i].title;
          this.ruleForm.userId = this.labResponsibleId[i].empId;
        }
      }
    },
    change3(value) {
      for (var i = 0; i < this.labResponsibleId.length; i++) {
        if (this.labResponsibleId[i].empId == value) {
          this.ruleForm.mailAuditId = this.labResponsibleId[i].empId;
          this.ruleForm.mailAuditDuty = this.labResponsibleId[i].title;
          this.ruleForm.mailAuditMail = this.labResponsibleId[i].mail;
        }
      }
    },
    remoteMethodId(query) {
      if (query.length >= 7) {
        getInforDemo(query).then((response) => {
          this.labResponsibleId = response.data;
        });
      }},
    
    //  // ICT专案代码
    getprojectNameList() {
      let str="ictCode"
      getoptionValue(str).then(response => {
        this.ict = response.data;
      });
    },

    getfactoryList() {
      let str = "bu";
      getoptionValue(str).then((response) => {
        this.from.factoryCode = response.data;
      });
    },
    getlocationFloorList() {
      // let str = "locationFloor";
      listFloor().then((response) => {
        this.from.projectFloor = response;
      });
    },
    // 厂区代码
    // 查询按钮
    selectList(from){
      getInfomactionList(from).then((res=>{
        this.tableData=res.rows
        this.formList.ictProjectCode=null
        this.formList.userId=null
        this.formList.ipAddress=null
        this.formList.macAddress=null
      }))
    },
    // 查看
    handleClick(val) {
      this.open = true
      this.ruleForm=val
    },
    submitBtn(val){
      this.open = true
      this.ruleForm=val
    },
    saveChange(val) {
      // 保存变更
      this.$refs.ruleForm.validate((valid) => {
        if (valid) {
          this.ruleForm.auditStatus = "待更新";
          updateInforDemo(this.ruleForm).then((res=>{
            this.$refs.ruleForm.resetFields()
            this.getList()
            this.open = false
          }))
          return false;
        }
        // 保存新增
      });
    },
    approve() {
      // 审核通过
      this.$refs.ruleForm.validate((valid) => {
        if (valid) {
          this.ruleForm.auditStatus = "已审核";
          updateInforDemo(this.ruleForm).then((res=>{
            console.log("up");
            this.$refs.ruleForm.resetFields()
            this.getList()
            this.open = false
          }))
          return false;
          // 保存新增
        }
      });
    },
    refresh(val) {
      //    刷新
      console.log(val);
      console.log(val.macAddress)
      getInforDemoList(val.macAddress).then((res=>{
        this.ruleForm=res.data
      }))
    },
    // 数据导出
    exportExcl(){
      const ruleForm = this.ruleForm;
      this.$modal.confirm('是否确认导出所有数据项?').then(() => {
        // this.exportLoading = true;
		console.log(1)
        return exportInfomaction(ruleForm);
      }).then(response => {
        this.$download.name(response.msg);
        // this.exportLoading = false;
      }).catch(() => {});
    },
    // 删除
    delbtn(val){
      var tId=val.tId
      delInfomaction(tId).then(res=>{
        getInfomactionList().then((res)=>{
          this.tableData=res.rows
        })
      })
    },
    // 获取列表
    getList(){
      getInfomactionList().then((res)=>{
        this.tableData=res.rows
      })
    },

  },
  watch: {
    '$route'(to, from) {
      this.getList()
      this.formList.ictProjectCode=""
      this.formList.userId=""
      this.formList.ipAddress=""
      this.formList.macAddress=""
    },
  },


  created() {
    this.getList()
    this.getprojectNameList()
    this.getfactoryList()
    this.getlocationFloorList()
  },
  mounted(){
    this.$nextTick(function () {
      // 仅在整个视图都被渲染之后才会运行的代码
      this.$refs.formList.resetFields()
      console.log(this.$refs.formList);
    })
  }
};
</script>
<style lang="scss" scoped>
		::v-deep {
		    .el-input__inner{
				font-size: 18px;
		         &::placeholder {
		            font-size: 18px;
		      }
		    }
		  }
		  .el-divider__text{
		  	font-size: 20px;
		  }
</style>
